package classes.view.component
{
	import com.greensock.TweenMax;
	import com.greensock.easing.Cubic;
	
	import flash.display.MovieClip;
	
	public class LoadingBar extends MovieClip
	{
		public function LoadingBar()
		{
			super();
			defaultSetting();
		}
		
		private var _loadingBarType:String;
		public function set loadingBarType($param:String):void
		{
			this._loadingBarType = $param;
		}
		
		public function get loadingBarType():String
		{
			return _loadingBarType;
		}
		
		public function set switchLoadingbar($param:Boolean):void
		{
			
			if($param){
				TweenMax.killTweensOf(this, false);
				TweenMax.to(this, 0.3, {autoAlpha:1, ease:Cubic.easeOut});
				gotoAndPlay(2);
			}else{
				TweenMax.killTweensOf(this, false);
				TweenMax.to(this, 0.2, {autoAlpha:0, ease:Cubic.easeOut});
				
				stop();
			}
		}
		
		private function defaultSetting():void
		{
			//this.mouseChildren = false;
			//this.mouseEnabled = false;
			
			this.visible = false;
			this.alpha   = 0;
			this.stop();
		}
		
	}
}